#include "Gateway.h"
#include "IEThernet.h"
void Gateway::onMessage(const String& msg){
	ethernet_.sendMessage(msg);
}
void Gateway::tick(long milliseconds){
	if(ethernet_.isInitialized() && ethernet_.isMessageReady()){
		postMessage(ethernet_.getMessage());
	}
}
Gateway::Gateway(IArduino& arduino, MessageRouter& router, IEthernet& eth, ILogger& logger) : 
Service(arduino, router, F("__GATEWAY__"), logger), ethernet_(eth) {
}
bool Gateway::isInfrastructure() const{
	return true;
}